package com.dh.blog.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dh.blog.dao.ClassifyDao;
import com.dh.blog.service.ClassifyService;
import com.dh.blog.vo.ClassifyVo;

@Service("classifyService")
@Transactional(readOnly=true)
public class ClassifyServiceImpl implements ClassifyService {
	@Resource
	private ClassifyDao classifyDao;
	@Override
	@Transactional(readOnly=false)
	public void doCreateOne(ClassifyVo classify) {
		classifyDao.addOne(classify);
	}

	@Override
	public ClassifyVo getByName(String name) {
		return classifyDao.getByDescription(name);
	}

	@Override
	@Transactional(readOnly=false)
	public int doDeleteOne(Integer classifyId) {
		return classifyDao.removeOne(classifyId);
	}

	@Override
	public List<ClassifyVo> listAllByBlog(String blogId) {
		return classifyDao.listAll(blogId);
	}

}
